/*
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2021-12-06 17:18:37
 * @LastEditTime: 2021-12-06 17:36:29
 * @LastEditors: 赵大壮
 */
import { Component, Vue, Inject } from "vue-property-decorator";
import DZServiceGoods from "../../service/DZServiceGoods";

@Component({
    components: {}
})
export default class Index extends Vue {
    s_goods = new DZServiceGoods();

    created() { }

    mounted() {
        this.action_list_goods();
    }

    beforeDestroy() {

    }

    action_list_goods() {
        this.s_goods.net_list_goods();
    }

    action_show_page(id) {
        this.$router.push({ path: '/goods/info', query: { id: id } })
    }
    action_save_sort(obj){
        this.s_goods.net_save_sort(obj.id,obj.sort,() => {
            this.s_goods.net_list_goods();
        })
    }
    action_del_goods(id) {
        this.s_goods.net_del_goods(id, () => {
            this.s_goods.net_list_goods();
        })
    }

    action_page_change(current) {
        this.s_goods.m_page.page = current;
        this.action_list_goods();
    }

    action_move_up(row) {
        this.s_goods.net_move_up(row.id, () => {
            this.action_list_goods();
        });
    }

    action_move_down(row) {
        this.s_goods.net_move_down(row.id, () => {
            this.action_list_goods();
        });
    }

    action_move_top(row) {
        this.s_goods.net_move_top(row.id, () => {
            this.action_list_goods();
        });
    }

    action_cancel_top(row) {
        this.s_goods.net_cancel_top(row.id, () => {
            this.action_list_goods();
        });
    }
}